/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Client.gui;

import Server.domain.Player;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;

/**
 *
 * @author Sander
 */
public class SkillsPanel extends ClientPanel implements ActionListener{
    
    private Player currentPlayer;
    private JButton nextButton;
    private JButton previousButton;
    private JPanel roll;
    private CardLayout cards;
    
    JPanel tree1;
    
   public SkillsPanel(ClientWindow parent)
    {
        super(parent);
        //currentPlayer = player;
        
        setLayout(new BorderLayout());
        
        roll = new JPanel();
        cards = new CardLayout();
        roll.setLayout(cards);
        add(BorderLayout.CENTER, roll);
        
        nextButton = new JButton("Next");
        nextButton.addActionListener(this);
        add(BorderLayout.EAST, nextButton);
        
        previousButton = new JButton("Previous");
        previousButton.addActionListener(this);
        add(BorderLayout.WEST, previousButton);
        
        JPanel points = new JPanel();
        add(BorderLayout.NORTH, points);
        points.setLayout(new GridLayout(1, 2));
        points.add(new JLabel("Available Skillpoints: ", SwingConstants.RIGHT));
        points.add(new JLabel("0", SwingConstants.LEFT));
        
        tree1 = new JPanel();
        tree1.add(new JLabel("Fighter"));
        roll.add(tree1);
        
        JPanel tree2 = new JPanel();
        JLabel tl2 = new JLabel("Assassin");
        tree2.add(tl2);
        roll.add(tree2);
        
        JPanel tree3 = new JPanel();
        JLabel tl3 = new JLabel("Bloodlust");
        tree3.add(tl3);
        roll.add(tree3);
        
     
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        if(e.getSource() == nextButton)
        {
            ((CardLayout)(roll.getLayout())).next(roll);
        }
        if(e.getSource() == previousButton)
        {
            ((CardLayout)(roll.getLayout())).previous(roll);
        }
    }
   
   
}
